home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / RLaB 1.15c / examples / sect_ex.r < prev    next >
Encoding:
Text File  |  1994-08-18  |  999 b   |  47 lines  |  [TEXT/RLAB]

  1. rfile section
  2.  
  3.   P = [0,0;0,14;16,14;16,13;1,13;1,2;11,2;11,0;0,0];
  4.   S = section(P);
  5.   show_prop(P,S);
  6.   pause();
  7.   
  8. //
  9. // Example 1:  Section properties of a rectangle
  10. //
  11.   A = [0,0;0,4;2,4;2,0;0,0];
  12.   S = section(A);
  13.   show_prop(A,S);
  14.   pause();
  15. //
  16. // Example 2:  Section properties of a triangle
  17. //
  18.   P = [0,0;0,1;1,0;0,0];
  19.   S = section(P);
  20.   show_prop(P,S);
  21.   pause();
  22. //
  23. // Example 3:  Section properties of an unit circle
  24. //
  25.   theta = (360:0:-5)';
  26.   r = ones(theta.nr,1);
  27.   S = section([r,theta],"polar");
  28.   show_prop([r,theta],S,"polar");
  29.   pause();
  30. //
  31. // Example 4:  Section properties of a C section
  32. //
  33.   P = [1,75;ones(42,1),(80:285:5)';1.2,285;ones(42,1)*1.2,(280:75:-5)'];
  34.   S = section(P,"polar");
  35.   show_prop(P,S,"polar");
  36.   pause();
  37. //
  38. // Example 5:  Section properties of a square with a center hole
  39. //
  40.   s2 = sqrt(2);
  41.   P = [10,0;10*s2,-45;10*s2,225;10*s2,135;10*s2,45;10,0;...
  42.        5*ones(73,1),(0:360:5)';10,0];
  43.   S = section(P,"polar");
  44.   show_prop(P,S,"polar");
  45.   pause();
  46.  
  47.